# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="Webserver log file analyzer"
HOMEPAGE="http://www.webdruid.org/"
PVV="0.6.0-alpha2-1"
SRC_URI="mirror://sourceforge/webdruid/${PN}-${PVV}.tar.gz"
S2="${WORKDIR}/${P/_/-}"

LICENSE="GPL-2"
KEYWORDS="~x86 ~amd64"
RESTRICT="nomirror"
IUSE="dns graphviz"

DEPEND=">=media-libs/freetype-2.1.5
	>=sys-libs/zlib-1.2.1
	>=media-libs/libpng-1.2
	>=media-libs/gd-1.8.4
	dns? ( =sys-libs/db-1.85-r1 )"
RDEPEND="$DEPEND
    media-fonts/freeserif
	graphviz? ( >=media-gfx/graphviz-1.10 )"

src_unpack() {
	unpack ${A}
}

src_compile() {
	cd ${S2}
	if use dns; then
		myconf="--enable-dns --with-db=/usr/include/db1/ --with-dblib=/usr/lib/libdb1.so"
	else
		myconf=""
	fi

	econf ${myconf} || die
	make || die
}

src_install() {
	cd ${S2}
	make DESTDIR=${D} install
}
